<template lang="pug">
.info-wrap
  MultiInfo(
    v-if="devicesData.length>1"
    v-bind="$props")
  SimpleInfo(
    v-else-if="devicesData.length===1"
    ref="info"
    v-bind="$props")
</template>

<script >
/**
 * @name DashboardInfo 历史数据页面
 * @author 陈可嘉
 * @description 各种指标历史数据的展示
 * @update linmn
 * @description 点击坐标跳转到历史数据页面
 */
import MultiInfo from './MultiInfo'
import SimpleInfo from './SimpleInfo'
export default {
  name: 'DashboardInfo',
  components: {
    MultiInfo,
    SimpleInfo
  },
  props: {
    target: String,
    parameterList: Array,
    devicesData: Array,
    interval: String,
    timeRange: Array
  },
  methods: {
    highLightTable (data) {
      if (this.$refs.info) {
        this.$refs.info.highLightTable(data)
      }
    }
  }
  // watch: {
  //   target (val) {
  //     console.log('改变', val)
  //   }
  // }
}
</script>

<style lang="sass" scoped>
.info-wrap
  width: 100%
  height: 100%
</style>
